<template>
	<view>
		<list-card v-for="item in article" :mode="item.mode" :key="item.id" :data="item"/>
		<uni-load-more v-if="article.length === 0 || article.length > 10" :status="loading"></uni-load-more>
	</view>
</template>

<script>
	import {
		mapState
	} from "vuex"
	export default {
		data() {
			return {
				article:[],
				loading:'loading',
			};
		},
		computed: {
			...mapState(['user_id'])
		},
		onLoad() {
			this.get_my_article()
		},
		methods:{
			async get_my_article(){
				let article = await this.$api.get_my_article({
					user_id: this.user_id
				})
				if (!article) return false;
				console.log(article);
				this.article = article
				this.loading ="noMore"
			}
		}
	}
</script>

<style lang="scss">

</style>
